package javabase.collection.map;

import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

public class MapEnhance {

	@SuppressWarnings("unchecked")
	public static void main(String[] args) {
		Map<String, String> map0 = new HashMap<String, String>() {
			private static final long serialVersionUID = 1L;
			{
				this.put("a", "人");
				this.put("b", "狗");
				this.put("c", "情");
				this.put("d", "未");
				this.put("e", "了");
			}
		};
		Set<Map.Entry<String,String>>  set =  map0.entrySet();
		Iterator<Map.Entry<String,String>> iter = set.iterator();
		while (iter.hasNext()) {
			Entry<String, String> e = iter.next();
			System.out.println(e.getKey() + "**" + e.getValue());
		}
		
		int initialCapacity = 6;
	     int capacity = 1;
	        while (capacity < initialCapacity)
	            capacity <<= 1;
	        System.out.println(capacity);
	        
	        Map<String, String> map007 = new HashMap<String, String>();
			Map<String, String> map008 = Collections.EMPTY_MAP;
	        if (map007 != null && map007.isEmpty()) {
	        	System.out.println(map007);
	        }
	        
	        if (map008 != null) {
	        	System.out.println(map008);
	        }
	}
}
